package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_student")
public class StudentBean {
    //学生id
    @TableId(value = "pk_studentId" , type = IdType.AUTO)
    private Integer id;
    //学生姓名
    @TableField("s_name")
    private String name;
    //学生性别
    @TableField("s_gender")
    private String gender;
    //学生电话
    @TableField("s_phone")
    private String phone;
    //班级对象
    @TableField(exist = false)
    private ClassBean classBean;
    //房间对象
    @TableField(exist = false)
    private RoomBean roomBean;
    //学生头像路径
    @TableField("s_imgPath")
    private String imgPath;
    //入住时间
    @TableField("s_date")
    private LocalDate date=LocalDate.now();
    @TableField("fk_roomId")
    private Integer roomId;
    @TableField("fk_classId")
    private Integer classId;

    public StudentBean() {
    }

    public StudentBean(String name, String gender, String phone, Integer classId, Integer roomId, String imgPath) {
        this.name = name;
        this.gender = gender;
        this.phone = phone;
        this.classBean = new ClassBean();
        classBean.setId(classId);
        this.roomBean = new RoomBean();
        roomBean.setId(roomId);
        this.imgPath = imgPath;
    }

    public StudentBean(String name, String gender, String phone, String imgPath, Integer roomId, Integer classId) {
        this.name = name;
        this.gender = gender;
        this.phone = phone;
        this.imgPath = imgPath;
        this.roomId = roomId;
        this.classId = classId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public ClassBean getClassBean() {
        return classBean;
    }

    public void setClassBean(ClassBean classBean) {
        this.classBean = classBean;
    }

    public RoomBean getRoomBean() {
        return roomBean;
    }

    public void setRoomBean(RoomBean roomBean) {
        this.roomBean = roomBean;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getRoomId() {
        return roomId;
    }

    public void setRoomId(Integer roomId) {
        this.roomId = roomId;
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    @Override
    public String toString() {
        return "StudentBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", phone='" + phone + '\'' +
                ", classBean=" + classBean +
                ", roomBean=" + roomBean +
                ", imgPath='" + imgPath + '\'' +
                ", date=" + date +
                ", roomId=" + roomId +
                ", classId=" + classId +
                '}'+"\n";
    }
}
